import pytest
import os

if __name__ == "__main__":
    # 生成测试结果原始数据
    pytest.main(["-v", "--alluredir=./reports/allure-results"])

    # 转换为HTML报告
    os.system("allure generate ./reports/allure-results -o ./reports/allure-report --clean")

    # 启动本地服务并打开浏览器
    os.system("allure serve ./reports/allure-results")